package tp.pr5.gui;

import java.util.Vector;

import javax.swing.JLabel;
import javax.swing.JPanel;

import tp.pr5.Directions;
import tp.pr5.GameObserver;
import tp.pr5.MapObserver;
import tp.pr5.PlayerObserver;
import tp.pr5.RoomInfo;
import tp.pr5.items.Item;

public class InfoPanel extends JPanel implements GameObserver, PlayerObserver,
		MapObserver {
	private JLabel textinfo;

	public InfoPanel() {
		textinfo = new JLabel();
		add(textinfo);
	}

	public void gameError(String msg) {
		this.textinfo.setText(msg);
	}

	public void gameHelp() {
	}

	public void gameOver(boolean win) {

		if (win) {
			this.textinfo.setText("FIN DEL JUEGO");
		} else {
			this.textinfo.setText("GAME OVER");
		}

	}

	public void gameQuit() {
	}

	public void gameStart(RoomInfo initialRoom, int playerPoints,
			int playerHealth) {
		this.textinfo.setText("Game Starts");

	}

	public void inventoryUpdate(java.util.List<Item> inventory) {
	}

	public void itemEmpty(java.lang.String itemName) {
	}

	public void itemLooked(java.lang.String description) {
	}

	public void itemUsed(String itemName) {
		this.textinfo.setText("Something changes");
	}

	public void playerDead() {
	}

	public void playerHasExaminedRoom(RoomInfo r) {
	}

	public void playerLookedInventory(java.util.List<Item> inventory) {
	}

	public void playerUpdate(int newHealth, int newScore) {
		this.textinfo.setText("Player atributes has been updated: ("
				+ newHealth + "," + newScore + ")");

	}

	public void roomEntered(Directions direction, RoomInfo targetRoom) {
	}

	@Override
	public void playerHasExamineRoom(RoomInfo room) {
		// TODO Auto-generated method stub

	}

	@Override
	public void inventoryUpdate(Vector<Item> inventory) {
		this.textinfo.setText("This inventory now contains " + inventory.size()
				+ " Items");

	}

	@Override
	public void playerLookedInventory(Vector<Item> inventory) {
		// TODO Auto-generated method stub

	}

}
